<template>
  <div id="app">
    <div class="common-layout">

          <el-header id="nav">
            <router-link to="/">主页</router-link>
<!--            <router-link to="/selectLevel">SelectLevel</router-link> |-->
            <router-link to="/selectWord" v-if="notHome()">|测试</router-link>
<!--            <el-progress :percentage=percent :format="format"></el-progress>-->
          </el-header>
        <el-main>
          <router-view/>
        </el-main>
    </div>

  </div>
</template>

<script>
export default {
  data(){
    return {
      percent: 0
    }
  },
  methods: {
    notHome(){
      console.log(this.$route.path)
      return this.$route.path != '/';
    }
    // format() {
      // console.log(this.percent)
      // const tmpPercent = this.$store.getters.getPercent
      // return this.percent === 100 ? '完成' : `${this.percent}%`;
      // return this.percent === 100 ? '完成' : this.percent+'%';
    // }
  },
  mounted() {
    this.$store.commit('setPercent', 0);
    // this.format()
  }
};
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  //text-align: center;
  color: #2c3e50;
}

#nav {
  //padding: 30px;
  background-color: #c4dce0;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      //color: #40b69e;
      color: #409EFF;
    }
    .active{
      color: #9dce6f;
    }
  }
}

.el-header, .el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  //color: #333;
  //text-align: center;
  //line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

</style>
